﻿using System.Collections.Generic;
using System.Linq;
using System.Windows;

namespace IOA.MES.Client.NameplatePrinting
{
    /// <summary>
    /// NameplateTip.xaml 的交互逻辑
    /// </summary>
    public partial class NameplateTip : Window
    {
        public NameplateTip()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Topmost = true;
        }

        public void SetData(List<KeyValuePair<string, string>> data)
        {
            lbBarCode.Content = data.FirstOrDefault(_ => string.Equals(_.Key, "条码", System.StringComparison.CurrentCultureIgnoreCase)).Value ?? "-";
            lbCurrentLevel.Content = data.FirstOrDefault(_ => string.Equals(_.Key, "档位", System.StringComparison.CurrentCultureIgnoreCase)).Value ?? "-";
            lbPowerLevel.Content = data.FirstOrDefault(_ => string.Equals(_.Key, "额定功率", System.StringComparison.CurrentCultureIgnoreCase)).Value ?? "-";
            lbNameplateModel.Content = data.FirstOrDefault(_ => string.Equals(_.Key, "铭牌型号", System.StringComparison.CurrentCultureIgnoreCase)).Value ?? "-";
        }
    }
}
